package com.ruoyi.stock2.service.impl;

import java.util.List;

import com.ruoyi.stock2.domain.TradeDataAndForetell;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock2.mapper.TRADEDATAMapper;
import com.ruoyi.stock2.domain.TRADEDATA;
import com.ruoyi.stock2.service.ITRADEDATAService;
import com.ruoyi.common.core.text.Convert;

/**
 * 交易数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2019-10-21
 */
@Service
public class TRADEDATAServiceImpl implements ITRADEDATAService 
{
    @Autowired(required = false)
    private TRADEDATAMapper tRADEDATAMapper;

    /**
     * 查询交易数据
     * 
     * @param id 交易数据ID
     * @return 交易数据
     */
    @Override
    public TRADEDATA selectTRADEDATAById(Long id)
    {
        return tRADEDATAMapper.selectTRADEDATAById(id);
    }

    /**
     * 查询交易数据列表
     * 
     * @param tRADEDATA 交易数据
     * @return 交易数据
     */
    @Override
    public List<TRADEDATA> selectTRADEDATAList(TRADEDATA tRADEDATA)
    {
        return tRADEDATAMapper.selectTRADEDATAList(tRADEDATA);
    }

    @Override
    public List<TRADEDATA> selectTradedataListForSeq2SeqTrainData(TRADEDATA tRADEDATA) {
        return tRADEDATAMapper.selectTradedataListForSeq2SeqTrainData(tRADEDATA);
    }

    @Override
    public List<TRADEDATA> selectTradedataListForFasttextTrainModelType(TRADEDATA tRADEDATA) {
        return tRADEDATAMapper.selectTradedataListForFasttextTrainModelType(tRADEDATA);
    }

    @Override
    public List<TRADEDATA> selectTradedataInput40Days(TRADEDATA tRADEDATA) {
        return tRADEDATAMapper.selectTradedataInput40Days(tRADEDATA);
    }

    @Override
    public List<TRADEDATA> selectTradedataTarget40Days(TRADEDATA tRADEDATA) {
        return tRADEDATAMapper.selectTradedataTarget40Days(tRADEDATA);
    }

    @Override
    public List<TradeDataAndForetell> selectTradeDataAndForetellListLessDate(TRADEDATA tRADEDATA) {
        return tRADEDATAMapper.selectTradeDataAndForetellListLessDate(tRADEDATA);
    }

    @Override
    public List<TradeDataAndForetell> selectTradeDataAndForetellListMoreDate(TRADEDATA tRADEDATA) {
        return tRADEDATAMapper.selectTradeDataAndForetellListMoreDate(tRADEDATA);
    }

    /**
     * 新增交易数据
     * 
     * @param tRADEDATA 交易数据
     * @return 结果
     */
    @Override
    public int insertTRADEDATA(TRADEDATA tRADEDATA)
    {
        return tRADEDATAMapper.insertTRADEDATA(tRADEDATA);
    }

    /**
     * 修改交易数据
     * 
     * @param tRADEDATA 交易数据
     * @return 结果
     */
    @Override
    public int updateTRADEDATA(TRADEDATA tRADEDATA)
    {
        return tRADEDATAMapper.updateTRADEDATA(tRADEDATA);
    }

    /**
     * 删除交易数据对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTRADEDATAByIds(String ids)
    {
        return tRADEDATAMapper.deleteTRADEDATAByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除交易数据信息
     * 
     * @param id 交易数据ID
     * @return 结果
     */
    public int deleteTRADEDATAById(Long id)
    {
        return tRADEDATAMapper.deleteTRADEDATAById(id);
    }

    @Override
    public List<TRADEDATA> get200ByKeyDateTimeDesc(TRADEDATA tRADEDATA){
        return tRADEDATAMapper.get200ByKeyDateTimeDesc(tRADEDATA);
    }

}
